<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
<%@page import="javax.portlet.*" %>
<%@page import="blo.ApproveBLO" %>
<%@page import="dto.WordDTO" %>
<%@page import="java.util.List" %>

<%@page import="org.apache.log4j.Logger"%><script type="text/javascript" src='/${requestScope.contextPath}/scripts/common.js' ></script>
<script type="text/javascript" src='/${requestScope.contextPath}/scripts/jquery-1.4.2.js' ></script>



<h1>Approving</h1>
<br>
${dictID}
${username}
<%
	
	int dictid = (Integer)request.getAttribute("dictID");
	String user = (String)request.getSession().getAttribute("username");
	ApproveBLO ablo = new ApproveBLO();
	List<WordDTO> wordDTO = ablo.getWordManageByUser(dictid, user);

	int lsize = wordDTO.size();
    

%>
<hr>
<form name="<portlet:namespace/>ApproNewWord" action="<portlet:actionURL/>" method="POST">
<input name="eventId" type="hidden" />
<input name="screenId" type="hidden" value="approvsuggestion"/>
<input name="dictID" type="hidden" value="${dictID}"/>
<input name="username" type="hidden" value="${username}"/> 
 
<table width="100%" border="1">
  <tr>
    <th colspan="3" bordercolor="#0066CC" scope="col">SUGGESTION</th>
    <th rowspan="2" bordercolor="#000099" scope="col">BY</th>
  </tr>
  <tr>
    <td colspan="2"><label>
      <div align="center">Word Entry</div>
    </label></td>
    <td><div align="center">Meaning</div></td>
  </tr>
<%--Loop Man,LOOP --%>
<%for(int i=0; i < lsize; i++) { %>
  <tr>
    <td>
        <input type="checkbox" name="wordID" value="<%out.print(wordDTO.get(i).getId()); %>" />
    </td>
    <td><%out.print(wordDTO.get(i).getWord()); %></td>
    <td><%out.print(wordDTO.get(i).getMeaning()); %></td>
    <td><%out.print("Anonymous"); %></td>
    
  </tr>
 <%} %> 
  
</table>
<p>
  <label>
  <input type="submit" name="Approve" value="Approve" onclick='submitAction("<portlet:namespace/>", "ApproNewWord", "approve");'/>
  </label>
  <label>
  <input type="submit" name="Discard" value="Discard" onclick='submitAction("<portlet:namespace/>", "ApproNewWord", "discard");'/>
  </label>
  <label>
  <input type="submit" name="Back" value="Back" onclick='submitAction("<portlet:namespace/>", "ApproNewWord", "back");'/>
  </label>
</p>
</form>